package vrp;

import com.google.appengine.api.datastore.Key;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Depot {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private Key partner;

    @Persistent
    private String name;

    @Persistent
    private String address;

    @Persistent
    private String postalCode;

    @Persistent
    private String contactNo;

    @Persistent
    private double lat;

    @Persistent
    private double lng;

    @Persistent
    private boolean isDepot;

    @Persistent
    private int status;

    @Persistent
    private Date createdAt;

    @Persistent
    private Date modifiedAt;

    public Depot(Key partner, String name, String address, String postalCode, String contactNo, double lat, double lng, boolean isDepot) {
    	this.partner = partner;
    	this.name = name;
        this.address = address;
        this.postalCode = postalCode;
        this.contactNo = contactNo;
        this.lat = lat;
        this.lng = lng;
        this.isDepot = isDepot;
    	this.status = 0; //0 for ok, non-0 for problem
    	this.createdAt = new Date();
    	this.modifiedAt = new Date();
    }

    public Key getKey() {
        return this.key;
    }

    public Key getPartner() {
        return this.partner;
    }

    public String getName() {
        return this.name;
    }

    public String getAddress() {
        return this.address;
    }

    public String getPostalCode() {
        return this.postalCode;
    }

    public String getContactNo() {
        return this.contactNo;
    }
    
    public double getLat() {
        return this.lat;
    }
    
    public double getLng() {
        return this.lng;
    }
    
    public boolean getIsDepot() {
        return this.isDepot;
    }
    
    public int getStatus() {
        return this.status;
    }

    public Date getCreatedAt() {
        return this.createdAt;
    }

    public Date getModifiedAt() {
        return this.modifiedAt;
    }
    
    public void setKey(Key someKey) {
    	this.key = someKey;
    }
    
    public void setPartner(Key partner) {
    	this.partner = partner;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAddress(String address) {
        this.address= address;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }
    
    public void setContactNo(String contactNo) {
        this.contactNo= contactNo;
    }    
    
    public void setLat(double lat) {
        this.lat= lat;
    }

    public void setLng(double lng) {
        this.lng= lng;
    }    

    public void setIsDepot(boolean isDepot) {
        this.isDepot = isDepot;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt= createdAt;
    }

    public void setModifiedAt(Date modifiedAt) {
        this.modifiedAt= modifiedAt;
    }
}